package com.example.redis.Utils;

import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import javax.swing.plaf.PanelUI;


@Component
public class MyRunner implements CommandLineRunner {
    @Resource
    private RedisUtil redisUtil;

    @Override
    public void run(String... strings) throws Exception {
        System.out.println("项目启动");
        redisUtil.set("key1", "testValue");
        System.out.println("获取redis中的值：" + redisUtil.get("key1"));
    }
}